package com.qf.rabbitmqcase.controller;

import com.qf.rabbitmqcase.constant.Constant;
import com.qf.rabbitmqcase.rabbitmq.SengMsg;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘欣
 * @createTime 2023/3/3 14:40
 * @description
 */
@RestController
@RequestMapping("/msg")
@Slf4j
public class MsgController {

    @Autowired
    private SengMsg sengMsg;

    private static final String routingKey = "msg.info.case";

    @RequestMapping("/sendMsg")
    public String sendMsg() {
        String msg = "dxlmessage";
        sengMsg.send(Constant.NORMAL_EXCHANGE_NAME, routingKey, msg);
        return "ok";
    }

}
